﻿@using Microsoft.AspNet.Identity

@*@Styles.Render("~/Content/cssBusiness")*@

@*@if (Request.IsAuthenticated)
    {*@
@{
    string temp = TempData["IsAuthen"] as string;

    //if (HttpContext.Current.User != null)
    //{
    //    string test = ((DHQGHN.PM2.Security.MyPrincipal)HttpContext.Current.User).FullName;
    //}

    if (HttpContext.Current.User.Identity.IsAuthenticated)
    {

    }

    //if (temp == "T")
    if (HttpContext.Current.User.Identity.IsAuthenticated)
    {
        using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
        {
            @Html.AntiForgeryToken()
            <div class="menuleft">
                <div id="mainNav" class="main_menu">
                    <span class="leftBG"></span><span class="rightBG"></span>
                    @* Quang_04/06/2015: Khoa phan menu fix cung, va goi den _LayoutMenu de test Menu dong*@
                    @Html.Partial("_PartialMenu")
                </div>
            </div>
            <div class="menuright">
                <div id="rightNav" class="main_menu">
                    <ul class="nav navbar-nav navbar-right">
                        <li>
                            <a id="menu1" onclick="setCookie('frontEnd',1,7);" href="#">
                                <span>
                                    @Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Manage", "Account", routeValues: null, htmlAttributes: new { title = "Manage" })
                                </span>
                            </a>
                        </li>
                        <li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
                    </ul>
                </div>
            </div>
        }
    }
    else
    {
        @*<ul class="nav navbar-nav navbar-right">
                <li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
                <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
            </ul>*@
    }
}